<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:app="http://java.sun.com/jsf/composite/app"
              xmlns:ds="http://deltaset.org/deltaset-faces"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:c="http://java.sun.com/jsp/jstl/core">


    <ds:titlebar title="#{addressMsg['view.title']}"/>


    <ds:fieldset rendered="#{not empty addressModel.id}">


        <ds:outputText label="#{addressMsg['city']}" value="#{addressModel.city}"/>
        <ds:outputText label="#{addressMsg['street']}" value="#{addressModel.street}"/>
        <ds:outputText label="#{addressMsg['zip']}" value="#{addressModel.zip}"/>
        <ds:outputText label="#{addressMsg['state']}" value="#{addressModel.state}"/>
        <ds:outputText label="#{addressMsg['longtitude']}" value="#{addressModel.longtitude}"/>
        <ds:outputText label="#{addressMsg['latitude']}" value="#{addressModel.latitude}"/> 

    </ds:fieldset>

    <ds:fieldset rendered="#{empty addressModel.id}">

        Please select Address <br/>

    </ds:fieldset>


    <c:set target="#{viewScope}" property="addressPageHelperMTO" value="#{addressBean.all(param.page)}"/>
    <ds:pagedDataTable rendered="#{not empty addressTarget}"
                       title="All Addresss"
                       pageHelper="#{viewScope.addressPageHelperMTO}"
                       pageParamName="page">
                       
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{addressMsg['city']}"/>
                </f:facet>
                <h:outputText value="#{item.city}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{addressMsg['street']}"/>
                </f:facet>
                <h:outputText value="#{item.street}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{addressMsg['zip']}"/>
                </f:facet>
                <h:outputText value="#{item.zip}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{addressMsg['state']}"/>
                </f:facet>
                <h:outputText value="#{item.state}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{addressMsg['longtitude']}"/>
                </f:facet>
                <h:outputText value="#{item.longtitude}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{addressMsg['latitude']}"/>
                </f:facet>
                <h:outputText value="#{item.latitude}"/>
            </h:column>
 

        <h:column>
            <h:commandButton styleClass="ds-button"
                             onmouseup="this.blur()"
                             immediate="true"
                             action="#{addressBean.setModelTo(item,addressTarget)}"
                             value="Select">
                <f:ajax execute="@form" render="@form"/>
            </h:commandButton>
        </h:column>
    </ds:pagedDataTable>

</ui:component>